﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

using EnvDTE;
using EnvDTE90;


namespace iMainAddin
{
    public delegate Form CreateFormFunction();
    public class iForm
    {
        static Dictionary<string, CreateFormFunction> m_Dictionary = new Dictionary<string,CreateFormFunction>();

        public static void Startup(EnvDTE.DTE application, AddIn addinInstance)
        {
            iCommand.Startup(application);
        }
        public static Form CreateForm(string formType)
        {
            CreateFormFunction function = null;
            if (m_Dictionary.TryGetValue(formType, out function))
                return function();
            else
                MessageBox.Show(formType + "is not found");
            
            return null;
        }
        public static String AddCreateFormFunction(string formType, CreateFormFunction createFunction)
        {
            m_Dictionary.Add(formType, createFunction);
            return formType;
        }
    }
}
